<template>
  <!-- 底部分类标签栏 -->
    <div class="bottom-Tabbar">
      <van-tabbar v-model="active" active-color="#ee0a24" inactive-color="#000" route>
        <van-tabbar-item icon="wap-home-o" to="/home">首页</van-tabbar-item>
        <van-tabbar-item icon="coupon-o" to="/category">分类</van-tabbar-item>
        <van-tabbar-item icon="bag-o" to="/worth">值得买</van-tabbar-item>
        <van-tabbar-item icon="shopping-cart-o" to="/cart">购物车</van-tabbar-item>
        <van-tabbar-item icon="friends-o" to="/personal" @click="toRegister">个人中心</van-tabbar-item>
      </van-tabbar>
    </div>
</template>
<script>
export default {
  name:"TreeSelect",
  data() {
    return {
      activeKey: 0,
      active: 0,
    };
  },
  methods: {
    toRegister(){
      const userInfo = JSON.parse(localStorage.getItem("userInfo"));
      !userInfo && this.$router.push('/register')
    }
  }
};
</script>

<style lang="less"scoped>
.bottom-Tabbar{
    position: fixed;
    left: 0;
    bottom: 0;
  }
</style>